package main

import "fmt"

// 实现两数相加

// 面向过程
func Add01(a, b int) int {
	return a + b
}

// 面向对象
type long int

func (val long) Add02(other long) long {
	return val + other
}

func main() {
	var result int
	result = Add01(1, 2)
	fmt.Println(result)

	val := long.Add02(1, 2)
	fmt.Println(val)

	var a long = 3
	add02 := a.Add02(3)
	fmt.Println(add02)
}
